<template>

  <bm-local-search
    :keyword="keyword"
    :auto-viewport="true"
    :panel="false"
    @searchcomplete="searchComplete"
  >
  </bm-local-search>

</template>

<script>

import BmLocalSearch from 'vue-baidu-map/components/search/LocalSearch'

export default {

  name: "MyLocalSearch",
  components: {
    BmLocalSearch,
  },
  props: {
    keyword: {
      default: '唐山市',
      type: [Array, String]
    },
  },
  data() {
    return {
      locationArr: [],
    }
  },

  created() {

  },

  mounted() {

  },

  methods: {
    searchComplete(arr) {
      let that = this;
      if (arr !== undefined && arr.Hr !== undefined && arr.Hr.length > 0) {
        that.locationArr = arr.Hr;
      }
      this.$emit('searchComplete', that.locationArr);
    },
  },


}
</script>

<style scoped>

</style>